package cn.cdeden.knowledge.service.dto;

import cn.cdeden.common.translation.annotation.Translation;
import cn.cdeden.common.translation.constant.TransConstant;
import cn.cdeden.knowledge.domain.EnterpriseMaterialFilesTree;
import cn.cdeden.knowledge.domain.dto.EnterprisePermDto;
import cn.cdeden.system.api.domain.vo.RemoteEnterprisePermVo;
import io.github.linpeilie.annotations.AutoMapper;
import io.github.linpeilie.annotations.AutoMappers;
import lombok.*;
import lombok.experimental.Accessors;
import org.springframework.web.multipart.MultipartFile;

import java.io.Serializable;

/**
* @author GW
* @date 2024-02-21
*/
@Data
@Builder
@Accessors(chain = true)
@NoArgsConstructor
@AllArgsConstructor
@EqualsAndHashCode(callSuper = false)
@AutoMappers({@AutoMapper(target = EnterpriseMaterialFilesTree.class)})
public class EnterpriseMaterialFilesTreeDto implements Serializable {
    private static final long serialVersionUID = 1L;

    private Long id;

    private String parentId;

    private String suffix;

    private String realName;

    private String type;

    private String fileStorageId;

    private String storageType;

    private Long fileSize;

    private Long imgSize;

    private String imgStorageId;

    @Translation(type = TransConstant.OSS_ID_TO_COVER_URL,mapper = "fileStorageId")
    private String imgUrl;

    private Long deptId;

    @Translation(type = TransConstant.DEPT_ID_TO_NAME,mapper = "deptId")
    private String deptName;
    private MultipartFile file;

    private MultipartFile img;

    public void setFileStorageId(String fileStorageId) {
        this.fileStorageId = fileStorageId;
        setImgUrl(fileStorageId);
    }
}
